<template>
    <div class="PatientSummary">
        <div class="Summary">
            <div class="lineOne">
                <h6>患者基本信息<i class="fa fa-chevron-circle-down"></i></h6>
                <div class="main">
                    <p>姓名：<span>测试</span></p>
                    <p>性别：<span>女</span></p>
                    <p>出生日期：<span>1941-06-22</span></p>
                    <p>联系电话：<span>18800000000</span></p>
                    <p>证件号：<span>18800000000</span></p>
                    <p>居住地址：<span>XXXXXXXXXX</span></p>
                    <p>联系人姓名：<span>测试</span></p>
                    <p>联系人电话：<span>18800000000</span></p>
                    <p>联系人地址：<span>XXXXXXXXXX</span></p>
                    <p>门诊号：<span>123456</span></p>
                    <p>住院号：<span>123456123456</span></p>
                    <p>EMPI：<span>123456-123456</span></p>
                    <p>医保卡号：<span>123123456</span></p>
                    <p>院内卡号：<span>123123456</span></p>
                </div>
            </div>
            <div class="lineTwo clearfix">
                <div>
                    <h6>临时医嘱<i class="fa fa-chevron-circle-right"></i></h6>
                    <div class="Tb">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>开始时间</th>
                                <th>医嘱内容</th>
                                <th>药品剂量</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>-</td>
                                <td></td>
                                <td></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div>
                    <h6>体检报告<i class="fa fa-chevron-circle-right"></i></h6>
                    <div class="Tb">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>创建时间</th>
                                <th>就诊类别</th>
                                <th>文档类别</th>
                                <th>创建医生</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>-</td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="lineThree">
                <div>
                    <h6>过敏信息<i class="fa fa-chevron-circle-right"></i></h6>
                    <div class="Tb">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>过敏源概览</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div>
                    <h6>病理报告<i class="fa fa-chevron-circle-right"></i></h6>
                    <div class="Tb">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>报告日期</th>
                                <th>检查类别</th>
                                <th>报告医生姓名</th>
                                <th>医疗机构名称</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>-</td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>
<script>
    export default {
        name: "Modularinformation",
        data() {
            return {
                msg: "SystemManagement 下的 Modularinformation",

            };
        },
        methods: {
            openDetails(row, index) {
                this.model_id = row.id;
                this.model_name = row.name;
                this.changeSelectStyle = index;
                if (this.model_XZBJ == "1") {
                    this.model_jm = row.id;
                    this.queryz();
                    this.changeSelectStyle = "0";
                    this.model_jm = "";
                }

                console.log(row);
            },
            handleChange(val) {
                console.log(val);
            },
            //主表保存
            savez() {
                if (this.model_name == "") {
                    this.$message({showClose: true, message: "模块名称不能为空！", type: "error"});
                    return;
                }
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11041",
                    input: {
                        "id": this.model_id == "" ? "1" : this.model_id,
                        "name": this.model_name
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.model_XZBJ = "1"
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                            document.getElementById("2").focus();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //删除主表信息
            deletez() {
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11043",
                    input: {
                        "id": this.model_id
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //主表查询

            queryz() {
                this.model_query = [];
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11042",
                    input: {
                        jm: this.model_jm ? this.model_jm : ""
                    }
                };
                console.log(data)
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (this.model_XZBJ == "1") {
                            this.model_query.push( res.data[res.data.length - 1]);this.model_XZBJ = "";
                            this.changeSelectStyle = "0";
                        } else {
                            this.model_query = res.data;
                            this.addMasterUser();
                        }
                        console.log("查询结果");
                        console.log(res);
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            submit1() {
                var ele = window.event.srcElement;
                var idcount = parseInt(ele.id) + 1;

                document.getElementById(idcount + "").focus();
            },

        },
        mounted(){

        },
        created() {
            this.msg = this.$route.query;
            console.log("接收过来的传参#############################################################################")
            console.log(this.msg)
            if (this.msg.Token != null && this.msg.Token != "") {
                console.log("设置Token")
                this.$setToken(this.msg.Token)
                this.$setItemUrl(this.msg.ItemIP)
                var loginInfor = this.msg.loginInfor;
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor != null) {
                    this.huizhenObj.Consult.HospitalId = this.LoginInfor.HospitalId
                    this.huizhenObj.Consult.DeptId = this.LoginInfor.UserId
                    this.huizhenObj.Consult.DoctorId = this.LoginInfor.UserId
                }
            } else {
                console.log("Token为空")
                var loginInfor = localStorage.getItem('LoginInfor');
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor == null) {
                    this.LoginInfor = {
                        SectionName: "",
                        UserName: ""
                    }
                }
            }

        }
    };
</script>

<style lang="scss">
    .PatientSummary{
        .Summary{padding: 0 15px;}
        .Summary h6{ background: #e8f2ff; font-size: 14px; color: #0089ef;margin: 0; height: 30px;
            line-height: 30px; padding: 0 0 0 10px;border: 1px solid #c7dfff; border-radius: 2px;}
        .Summary h6 i{ float: right; font-size: 18px; line-height: 30px; padding: 0 10px;}
        .Summary .lineOne .main{ padding: 10px 15px;min-height: 170px;border: 1px solid #ddd;
            margin-bottom: 10px;margin-top: -1px;}
        .Summary .lineOne .main p{ width: 33.33%; float: left;line-height: 26px;}
        .Summary .lineTwo{margin-bottom: 10px;}
        .Summary .lineTwo>div,
        .Summary .lineThree>div{ width: 50%; float: left;}
        .Summary .lineTwo>div:first-child,
        .Summary .lineThree>div:first-child{ padding-right: 15px;}
        .Summary .Tb{ min-height: 180px;margin-top: -1px;}
    }

</style>
